Skip to content

test(aggregator): executable /aa chart zoom/pan viewBox coverage (#9581) - #9582

Merged
dezren39 merged 1 commit into
mainfrom
queue/16124-9581-chart-zoom-tests
Nov 13, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/16124-9581-chart-zoom-tests

Conversation

@dezren39

@dezren39 dezren39 commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Closes #9581. Task task 16124 (lane code-a).

What

The /aa chart zoom/pan layer from #4154 was covered only by string-presence assertions in aa.test.ts — no test executed the behavior or asserted a resulting viewBox.

Following the #7562 pattern, the pure viewBox math moves out of the explorer's inline script into the shared, tested module src/assets/aa-explorer-computations.js:

  • parseChartViewBox, effectiveChartView, clampChartView, zoomChartView, panChartView, resetChartView, chartClickSuppressed (new, with .d.ts declarations)
  • render.ts: the enhancer's zoom/pan/reset/click handlers now delegate to those module functions — no inline copies, so the tests exercise exactly the code the browser runs. No behavior change: the math is line-for-line the previous inline code.

Tests (oracle: the #9581 acceptance criteria)

New executable tests in test/aa-explorer-computations.test.ts drive the module functions and assert resulting viewBox values:

  • zoom focal anchoring (focal data point stays at the same fraction) + aspect preservation, centred default
  • 16x floor (base width / 16, stable under repeated zoom-in)
  • zoom-out-to-base clears the zoom state (cur null, effective view = base)
  • pan pixel-to-viewBox scaling and clamping at all base edges, incl. non-zero base origin; pan no-ops when unzoomed or sizeless
  • reset restores the base viewBox after zoom + pan
  • click suppression: stamp within 400 ms swallowed; at/after 400 ms passes; no stamp (ordinary click) never swallowed

test/aa.test.ts additionally pins that the shipped page imports these functions from the computations module and carries no inline definitions of them.

Verification

  • bun test test/aa-explorer-computations.test.ts — 15/15 pass (9 new)
  • bun test test/aa.test.ts — 47/47 pass (run with PM_AGG_FRESHNESS_PORT=4899: the default freshness port 4871 is held by the laptop's production aggregator, a pre-existing environment collision unrelated to this change)
  • bun test test/render.test.ts test/a11y-1215.test.ts test/epic-graph.test.ts — 82/82 pass
  • bunx tsc --noEmit — error set identical to main (22 pre-existing, none in touched files)

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Extract the pure chart viewBox math from the AA explorer inline script into aa-explorer-computations.js (parse/clamp/zoom/pan/reset/click-suppression, #7562 pattern); the browser enhancer delegates to it with no inline copies. Add executable tests asserting resulting viewBox values for focal anchoring, the 16x floor, zoom-out-to-base clearing state, pan clamping, and reset, plus the click-suppression contract, and pin the delegation in aa.test.ts.
@dezren39
dezren39 requested a review from a team as a code owner November 13, 2026 15:51
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-13T15:51:47.515825Z
We couldn’t complete this review. Comment @codex review to try again.
2e9dc9d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 35 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a9d7ac5b-6767-4390-8f14-9372f236ae22
Commits

Reviewing files that changed from the base of the PR and between bb6ce2e and 2e9dc9d.

Files selected for processing: 5

  • pm-stack/aggregator/src/assets/aa-explorer-computations.d.ts
  • pm-stack/aggregator/src/assets/aa-explorer-computations.js
  • pm-stack/aggregator/src/render.ts
  • pm-stack/aggregator/test/aa-explorer-computations.test.ts
  • pm-stack/aggregator/test/aa.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@dezren39

Copy link
Copy Markdown
Member Author

Codex disposition (task 16124): the Codex code review on this PR failed to run — usage limits, per the Codex Review Summary comment above (2026-11-13T15:51Z, commit 2e9dc9d). There are no Codex findings or review threads on this PR to disposition; this matches the fleet-wide Codex usage-limit state first seen 2026-11-13T13:51Z. CodeRabbit likewise rate-limited (NEUTRAL). Merge proceeds on local verification: aggregator bun suites 15/15 + 47/47 + 82/82 and a tsc error set identical to main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(aggregator): /aa chart zoom/pan behavior from #4154 has only string-presence tests — no executable coverage

1 participant